import request from "@/utils/request";

// 查询字典数据列表
export function GetListAPI(params: object) {
  return request({
    url: "/system/dict/type/list",
    method: "get",
    params,
  });
}

// 查询字典数据详细
export function GetViewAPI(dictCode: string) {
  return request({
    url: "/system/dict/type/" + dictCode,
    method: "get",
  });
}

// 根据字典类型查询字典数据信息
export function GetDictTypeAPI(dictType: string) {
  return request({
    url: "/system/dict/type/" + dictType,
    method: "get",
  });
}

// 新增字典数据
export function AddDataAPI(data: object) {
  return request({
    url: "/system/dict/type/",
    method: "post",
    data,
  });
}

// 修改字典数据
export function EditDataAPI(data: object) {
  return request({
    url: "/system/dict/type/",
    method: "put",
    data,
  });
}

// 删除字典数据
export function DelDataAPI(dictCode: string) {
  return request({
    url: "/system/dict/type//" + dictCode,
    method: "delete",
  });
}
